package org.example.gxpt.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.gxpt.pojo.entity.Showroom;

import java.util.List;

@Mapper
public interface ShowroomMapper {

    /**
     * 保存展厅
     * @param showroom
     */
    void save(Showroom showroom);


    /**
     * 根据展厅id查询展厅
     * @param showroomId
     * @return
     */
    @Select("select * from showroom where id = #{showroomId}")
    Showroom getShowroomById(Long showroomId);

    /**
     * 更新展厅
     * @param showroom
     */
    void update(Showroom showroom);

    /**
     * 查询所有展厅
     * @return
     */
    @Select("select * from showroom")
    List<Showroom> listAll();

    /**
     * 删除展厅
     * @param id
     */
    @Delete("delete from showroom where id = #{id}")
    void delete(Long id);
}
